package com.studyadmin.controller;



import com.studyadmin.service.CourseService;
import com.studyadmin.util.JsonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;



/**
 * <p>
 * 课程表 前端控制器
 * </p>
 *
 * @author lyl
 * @since 2023-03-19
 */
@RestController
@RequestMapping("/studyadmin/course")
@CrossOrigin
public class CourseController {

    @Autowired
    CourseService courseService;

    /**
     * 学生端课程展示
     * @return 查询结果集
     */
    @RequestMapping("/courseList")
    public JsonUtil courseList(){
        return  courseService.courseListSer();
    }

    /**
     * 学生章节视频学习数据
     * @param stuNum  学生id
     * @param courseId 课程id
     * @return
     */
    @GetMapping("/StuSituation")
    public JsonUtil StuLearningSituation(@RequestParam(value = "stuNum") String stuNum,
    @RequestParam(value = "courseId") String courseId){
        return courseService.StuLearningSituationSer(stuNum,courseId);

    }

    /**
     * 作业完成情况
     * @param stuNum 选择 的学生id
     * @param courseId 课程id
     * @return
     */
    @GetMapping("/StuSituationWork")
    public JsonUtil StuLearningSituationWork(@RequestParam(value = "stuNum") String stuNum,
                                         @RequestParam(value = "courseId") String courseId){
        return courseService.StuLearningWorkSer(stuNum,courseId);

    }


    /**
     * 课程完成数据 Schedule进度  教师端，学生端查看学生学习数据接口
     * @param stuNum 选择 的学生id
     *
     * @return
     */
    @GetMapping("/StuSchedule")
    public JsonUtil StuCourseSchedule (@RequestParam(value = "stuNum") String stuNum){
        return courseService.StuScheduleSer(stuNum);

    }



}

